package com.bloom.demo.utils;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Spring 实用程序
 *
 * @author Amadeus
 * @date 2025/01/14
 */
public class SpringUtil implements ApplicationContextInitializer<ConfigurableApplicationContext> {

    private static ConfigurableApplicationContext configurableApplicationContext;


    public static String getPrefixDistinctionName() {
        return configurableApplicationContext.getEnvironment().getProperty(Constant.PREFIX_DISTINCTION_NAME,
                Constant.DEFAULT_PREFIX_DISTINCTION_NAME);
    }

    @Override
    public void initialize(final ConfigurableApplicationContext applicationContext) {
        configurableApplicationContext = applicationContext;
    }
}
